﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using BUS;

namespace EC21_EDiamond.Admin
{
    public partial class QuanLyPhiVanChuyen : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnThemTinh_Click(object sender, EventArgs e)
        {
            TinhDTO tinhDTO = new TinhDTO();
            tinhDTO.TenTinh = txtTenTinh.Text;
            tinhDTO.Phivanchuyen = int.Parse(txtPhiVanChuyen.Text);

            TinhBUS tinhBUS = new TinhBUS();
            if (tinhBUS.KiemTraTinhTrung(tinhDTO.TenTinh) == 0)
            {
                if (tinhBUS.ThemTinh(tinhDTO) == 1)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Thành công!');", true);
                    GridView1.DataBind();
                }
            }
        }
    }
}